\hypertarget{classduye_1_1_transfer}{\section{duye\-:\-:Transfer Class Reference}
\label{classduye_1_1_transfer}\index{duye\-::\-Transfer@{duye\-::\-Transfer}}
}


transfer api  




{\ttfamily \#include $<$duye\-\_\-socket.\-h$>$}

\subsection*{Static Public Member Functions}
\begin{DoxyCompactItemize}
\item 
static bool \hyperlink{classduye_1_1_transfer_a97fd2cd41d8f15ac5d971b65bf8b93c2}{bind} (const int32 server\-Sockfd, const struct sockaddr $\ast$client\-Addr, const uint32 addr\-Len)
\begin{DoxyCompactList}\small\item\em accept client to connect \end{DoxyCompactList}\item 
static bool \hyperlink{classduye_1_1_transfer_af74c77a25f623478e3a0ab1561c88b57}{listen} (const int32 server\-Sockfd, const uint32 max\-Connect)
\begin{DoxyCompactList}\small\item\em accept client to connect \end{DoxyCompactList}\item 
static int32 \hyperlink{classduye_1_1_transfer_a256ad35e335896f450cb3195a03f47ad}{accept} (const int32 server\-Sockfd, struct sockaddr $\ast$client\-Addr, const uint32 addr\-Len, const bool is\-Block=true)
\begin{DoxyCompactList}\small\item\em accept client to connect \end{DoxyCompactList}\item 
static bool \hyperlink{classduye_1_1_transfer_a06e6f316f642b5582000236fbcaced50}{connect} (const int32 client\-Sockfd, const struct sockaddr $\ast$server\-Addr, const uint32 addr\-Len)
\begin{DoxyCompactList}\small\item\em accept client to connect \end{DoxyCompactList}\item 
static int64 \hyperlink{classduye_1_1_transfer_abe95f0b1096006b8dfca8cd12f3627da}{send} (const int32 sockfd, const int8 $\ast$data, const uint64 len)
\begin{DoxyCompactList}\small\item\em send data \end{DoxyCompactList}\item 
\hypertarget{classduye_1_1_transfer_a2fed2796763a0be625f966bc26b6ff92}{static int64 {\bfseries sendmsg} (const int32 sockfd, const struct msghdr $\ast$msg)}\label{classduye_1_1_transfer_a2fed2796763a0be625f966bc26b6ff92}

\item 
\hypertarget{classduye_1_1_transfer_afa0149eb21dbfc12b616535d35b84af7}{static int64 {\bfseries sendto} (const int32 sockfd, \hyperlink{classduye_1_1_i_pv4_addr}{I\-Pv4\-Addr} \&dst\-Addr, const int8 $\ast$data, const uint64 len)}\label{classduye_1_1_transfer_afa0149eb21dbfc12b616535d35b84af7}

\item 
static int64 \hyperlink{classduye_1_1_transfer_a595b20d876d7744ad29c0891c1f1e485}{recv} (const int32 sockfd, int8 $\ast$buffer, const uint64 size, const bool block)
\begin{DoxyCompactList}\small\item\em receive data \end{DoxyCompactList}\item 
\hypertarget{classduye_1_1_transfer_ad0067f8b76f48f62a745c71b43ddc4d9}{static int64 {\bfseries recvmsg} (const int32 sockfd, struct msghdr $\ast$msg, const bool block)}\label{classduye_1_1_transfer_ad0067f8b76f48f62a745c71b43ddc4d9}

\item 
\hypertarget{classduye_1_1_transfer_afc2a0ec59e0216c0a9ea4e4398fa43a1}{static int64 {\bfseries recvfrom} (const int32 sockfd, \hyperlink{classduye_1_1_i_pv4_addr}{I\-Pv4\-Addr} \&src\-Addr, int8 $\ast$buffer, const uint64 size, const bool block)}\label{classduye_1_1_transfer_afc2a0ec59e0216c0a9ea4e4398fa43a1}

\end{DoxyCompactItemize}


\subsection{Detailed Description}
transfer api 

\subsection{Member Function Documentation}
\hypertarget{classduye_1_1_transfer_a256ad35e335896f450cb3195a03f47ad}{\index{duye\-::\-Transfer@{duye\-::\-Transfer}!accept@{accept}}
\index{accept@{accept}!duye::Transfer@{duye\-::\-Transfer}}
\subsubsection[{accept}]{\setlength{\rightskip}{0pt plus 5cm}static int32 duye\-::\-Transfer\-::accept (
\begin{DoxyParamCaption}
\item[{const int32}]{server\-Sockfd, }
\item[{struct sockaddr $\ast$}]{client\-Addr, }
\item[{const uint32}]{addr\-Len, }
\item[{const bool}]{is\-Block = {\ttfamily true}}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [static]}}}\label{classduye_1_1_transfer_a256ad35e335896f450cb3195a03f47ad}


accept client to connect 


\begin{DoxyParams}[1]{Parameters}
\mbox{\tt in}  & {\em server\-Sockfd} & \-: output client address infomation \\
\hline
\mbox{\tt out}  & {\em client\-Addr} & \-: client address \\
\hline
\mbox{\tt in}  & {\em addr\-Len} & \-: client length \\
\hline
\mbox{\tt in}  & {\em is\-Block} & \-: block/unblock, default is block \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
On success, return a nonnegative integer that is a descriptor for the accepted socket. On error, -\/1 is returned 
\end{DoxyReturn}
\hypertarget{classduye_1_1_transfer_a97fd2cd41d8f15ac5d971b65bf8b93c2}{\index{duye\-::\-Transfer@{duye\-::\-Transfer}!bind@{bind}}
\index{bind@{bind}!duye::Transfer@{duye\-::\-Transfer}}
\subsubsection[{bind}]{\setlength{\rightskip}{0pt plus 5cm}static bool duye\-::\-Transfer\-::bind (
\begin{DoxyParamCaption}
\item[{const int32}]{server\-Sockfd, }
\item[{const struct sockaddr $\ast$}]{client\-Addr, }
\item[{const uint32}]{addr\-Len}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [static]}}}\label{classduye_1_1_transfer_a97fd2cd41d8f15ac5d971b65bf8b93c2}


accept client to connect 


\begin{DoxyParams}[1]{Parameters}
\mbox{\tt in}  & {\em server\-Sockfd} & \-: output client address infomation \\
\hline
\mbox{\tt in}  & {\em client\-Addr} & \-: client address \\
\hline
\mbox{\tt in}  & {\em addr\-Len} & \-: client length \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
On success, return true. On error, false is returned 
\end{DoxyReturn}
\hypertarget{classduye_1_1_transfer_a06e6f316f642b5582000236fbcaced50}{\index{duye\-::\-Transfer@{duye\-::\-Transfer}!connect@{connect}}
\index{connect@{connect}!duye::Transfer@{duye\-::\-Transfer}}
\subsubsection[{connect}]{\setlength{\rightskip}{0pt plus 5cm}static bool duye\-::\-Transfer\-::connect (
\begin{DoxyParamCaption}
\item[{const int32}]{client\-Sockfd, }
\item[{const struct sockaddr $\ast$}]{server\-Addr, }
\item[{const uint32}]{addr\-Len}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [static]}}}\label{classduye_1_1_transfer_a06e6f316f642b5582000236fbcaced50}


accept client to connect 


\begin{DoxyParams}[1]{Parameters}
\mbox{\tt in}  & {\em client\-Sockfd} & \-: client socketfd \\
\hline
\mbox{\tt out}  & {\em server\-Addr} & \-: server address \\
\hline
\mbox{\tt in}  & {\em addr\-Len} & \-: client length \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
On success, return true. On error, return false 
\end{DoxyReturn}
\hypertarget{classduye_1_1_transfer_af74c77a25f623478e3a0ab1561c88b57}{\index{duye\-::\-Transfer@{duye\-::\-Transfer}!listen@{listen}}
\index{listen@{listen}!duye::Transfer@{duye\-::\-Transfer}}
\subsubsection[{listen}]{\setlength{\rightskip}{0pt plus 5cm}static bool duye\-::\-Transfer\-::listen (
\begin{DoxyParamCaption}
\item[{const int32}]{server\-Sockfd, }
\item[{const uint32}]{max\-Connect}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [static]}}}\label{classduye_1_1_transfer_af74c77a25f623478e3a0ab1561c88b57}


accept client to connect 


\begin{DoxyParams}[1]{Parameters}
\mbox{\tt in}  & {\em server\-Sockfd} & \-: output client address infomation \\
\hline
\mbox{\tt in}  & {\em max\-Connect} & \-: max connection numbers \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
On success, return true. On error, false is returned 
\end{DoxyReturn}
\hypertarget{classduye_1_1_transfer_a595b20d876d7744ad29c0891c1f1e485}{\index{duye\-::\-Transfer@{duye\-::\-Transfer}!recv@{recv}}
\index{recv@{recv}!duye::Transfer@{duye\-::\-Transfer}}
\subsubsection[{recv}]{\setlength{\rightskip}{0pt plus 5cm}static int64 duye\-::\-Transfer\-::recv (
\begin{DoxyParamCaption}
\item[{const int32}]{sockfd, }
\item[{int8 $\ast$}]{buffer, }
\item[{const uint64}]{size, }
\item[{const bool}]{block}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [static]}}}\label{classduye_1_1_transfer_a595b20d876d7744ad29c0891c1f1e485}


receive data 


\begin{DoxyParams}[1]{Parameters}
\mbox{\tt in}  & {\em sockfd} & \-: socket fd \\
\hline
\mbox{\tt out}  & {\em buffer} & \-: output buffer \\
\hline
\mbox{\tt in}  & {\em size} & \-: buffer size \\
\hline
\mbox{\tt in}  & {\em block} & \-: block \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
on success, return the number of bytes received. on error, return -\/1, The return value will be 0 when the peer has performed an orderly shutdown. 
\end{DoxyReturn}
\begin{DoxyNote}{Note}

\end{DoxyNote}
\hypertarget{classduye_1_1_transfer_abe95f0b1096006b8dfca8cd12f3627da}{\index{duye\-::\-Transfer@{duye\-::\-Transfer}!send@{send}}
\index{send@{send}!duye::Transfer@{duye\-::\-Transfer}}
\subsubsection[{send}]{\setlength{\rightskip}{0pt plus 5cm}static int64 duye\-::\-Transfer\-::send (
\begin{DoxyParamCaption}
\item[{const int32}]{sockfd, }
\item[{const int8 $\ast$}]{data, }
\item[{const uint64}]{len}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [static]}}}\label{classduye_1_1_transfer_abe95f0b1096006b8dfca8cd12f3627da}


send data 


\begin{DoxyParams}[1]{Parameters}
\mbox{\tt in}  & {\em sockfd} & \-: socket fd \\
\hline
\mbox{\tt in}  & {\em data} & \-: send data \\
\hline
\mbox{\tt in}  & {\em len} & \-: data length \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
on success, return the number of characters sent. on error, return -\/1 
\end{DoxyReturn}
\begin{DoxyNote}{Note}

\end{DoxyNote}


The documentation for this class was generated from the following file\-:\begin{DoxyCompactItemize}
\item 
Z\-:/duye/src/duyebase/system/\hyperlink{duye__socket_8h}{duye\-\_\-socket.\-h}\end{DoxyCompactItemize}
